package com.allwees.bs.module.oms.dto;

import com.allwees.bs.module.oms.entity.OrderSkuSnap;
import com.allwees.bs.module.pms.entity.Sku;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrderSkuSnapDto implements Serializable {
	private String uuid;

	private String skuNo;

	private String color;

	private String size;

	private String[] photos;

	private BigDecimal originalPrice;

	private BigDecimal retailPrice;

	private String currency;

	private Integer quantity;

	public OrderSkuSnapDto(Sku sku) {
		this.setUuid(sku.getUuid());
		this.setSkuNo(sku.getNo());
		this.setColor(sku.getColor());
		this.setSize(sku.getSize());
		this.setOriginalPrice(sku.getOriginalPrice());
		this.setRetailPrice(sku.getRetailPrice());
		this.setCurrency(sku.getCurrency());
	}

	public OrderSkuSnapDto(OrderSkuSnap orderSnapItem) {
		if(orderSnapItem == null) {
			return;
		}
		this.setUuid(orderSnapItem.getSkuUuid());
		this.setSkuNo(orderSnapItem.getSkuNo());
		this.setColor(orderSnapItem.getSkuColor());
		this.setSize(orderSnapItem.getSkuSize());
		this.setPhotos(orderSnapItem.getPhotos());
		this.setOriginalPrice(orderSnapItem.getSkuOriginPrice());
		this.setRetailPrice(orderSnapItem.getSkuRetailPrice());
		this.setQuantity(orderSnapItem.getQuantity());
	}
}
